package com.example.demo.repository;

import com.example.demo.domain.Role;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Modifying;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.query.Param;
import org.springframework.stereotype.Repository;

/**
 * 角色管理Repository
 *
 * @Author zmf
 * @Date 2018/12/12  17:33
 */
@Repository
public interface RoleRepository extends JpaRepository<Role, Long> {
    @Modifying
    @Query("update Role set fullRoleId =:fullRoleId where roleId =:roleId")
    void updateFullRoleId(@Param(value = "fullRoleId") String fullRoleId,
                          @Param(value = "roleId") Long roleId);
}
